CREATE TABLE [dbo].[TTAMAR_CPIN]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTAMAR_CP__NU_PR__3E7D2C94] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_CP__CO_US__3F7150CD] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_CP__FE_US__40657506] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_CP__CO_US__4159993F] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_CP__FE_US__424DBD78] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_CPIN] ADD CONSTRAINT [PK__TTAMAR_C__DB895B803C6AC6F0] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_AMAR], [CO_UNID_CONC], [FE_AMAR], [NU_PROC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_CPIN] ADD CONSTRAINT [FK__TTAMAR_CPIN__2F30C763] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR]) REFERENCES [dbo].[TTAMAR_CPAG] ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR])
GO
